<%
def sesUser = session?.user
%>
<html>
<head>
	<title>${application.appName} - ${request.title}</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
		
	<script type="text/javascript" src="js/jquery-1.6.1.js"></script>

	<script type="text/javascript" src="js/jquery-ui-1.8.12.custom.min.js"></script>
	<link type="text/css" href="css/${application.appTheme}/jquery-ui-1.8.12.custom.css" rel="stylesheet" />
	 
	<script src="js/jquery.validationEngine-en.js" type="text/javascript"></script> 
	<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
	<link href="css/jquery.validationEngine.css" type="text/css" rel="stylesheet"/>

	<script type="text/javascript" src="js/jquery.fixedMenu.js"></script>
		
	<script type="text/javascript" src="js/date.js"></script> 
	<script type="text/javascript" src="js/moment.min.js"></script>
	
	<script type="text/javascript" src="js/jquery.tablesorter.js"></script> 

	<link type="text/css" href="css/tipsy.css" rel="stylesheet" />
	<script type="text/javascript" src="js/jquery.tipsy.js"></script>
	
	<link type="text/css" href="css/${application.appTheme}/wyd.css" rel="stylesheet" />
	<script type="text/javascript" src="js/wyd.js"></script>

	<link type="text/css" href="css/jquery-ui-timepicker-addon.css" rel="stylesheet" />
	<script type="text/javascript" src="js/jquery-ui-timepicker-addon.js"></script>
	
	<link href="css/jquery_notification.css" type="text/css" rel="stylesheet"/>
	<script type="text/javascript" src="js/jquery_notification_v.1.js"></script>

	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
		
	<script type="text/javascript"> 
		\$(document).ready(function() {
			\$('.menu').fixedMenu();
			\$('[title]').tipsy({ gravity : \$.fn.tipsy.autoWE });
		});
	</script>

	<% if(!localMode) { %>

	<script type="text/javascript">
	  var _gaq = _gaq || [];
	  _gaq.push(['_setAccount', 'UA-27276914-1']);
	  _gaq.push(['_setDomainName', 'watchyourexpenses.appspot.com']);
	  _gaq.push(['_trackPageview']);
	
	  (function() {
	    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	  })();
	</script>
	<% } %>
</head>
<body>
<div id="header"> 
<div id="header-1">
	<a href="wydIndex.groovy"><span class="logo">${application.appName}</span></a>
</div>
<div id="header-2">
	<div id="header-2-inner">
		<ul class="header-menu">
		<% if(sesUser != null) { %>
			<li><a class="header-link" href="profile.groovy">Profile[$sesUser.id]</a></li>
		<% } %>
			<li><a class="header-link" href="about.groovy">About</a></li>
		</ul>
	</div>
	<div id="header-2-inner">
		<ul class="header-menu">
		<% if(sesUser != null) { %>
			<li><a class="header-link" href="logout.groovy">Logout</a></li>
		<% } else { %>
			<li><a class="header-link" href="login.groovy">Login</a></li>
		<% } %>
		</ul>
	</div>
</div>
</div>
<%
def cid = null, msg = null
if(request.errorMessage) {
	cid = 'ui-state-error'
	msg = request.errorMessage
}
if(request.infoMessage) {
	cid = 'ui-state-highlight'
	msg = request.infoMessage
}
if(cid != null) {
%>
<div class="ui-widget" style="float: center; margin-left: auto; margin-right: auto; margin-bottom: 5px; width: 1000px; text-align: left;"> 
	<div class="${cid} ui-corner-all" style="padding: 0 .7em;"> 
	<strong><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>$msg</strong> 
	</div> 
</div> 
<%
	}
%>
<div id="navigator">
	<div id="navigator-inner"> 
		<div id="navigator-inner-1">
				<a href="#"><img src="images/${application.appTheme}/icons/help_16x16.png" border="0"/></a>
				<span class="h1">${request.title}</span>
		</div>
		<div id="navigator-inner-2">
		<% include 'wydMenu.gsp' %>
		</div>
	</div>
</div>

<div id="center"> 
	<% include request.view %>
</div> 
<br />
</body>
</html>
